package com.exposit.zbs.service.impl;

import com.exposit.zbs.dao.IMoneyTransferDAO;
import com.exposit.zbs.entity.MoneyTransferEntity;
import com.exposit.zbs.model.MoneyTransfer;
import com.exposit.zbs.service.IMoneyTransferService;
import org.dozer.DozerBeanMapperSingletonWrapper;
import org.dozer.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class MoneyTransferService implements IMoneyTransferService {

	@Autowired
	private IMoneyTransferDAO moneyTransferDAO;

	@Override
	public Long saveMoney(MoneyTransfer moneyTransfer) {

		Mapper mapper = DozerBeanMapperSingletonWrapper.getInstance();
		MoneyTransferEntity entity = new MoneyTransferEntity();
		mapper.map(moneyTransfer, entity);
		return moneyTransferDAO.save(entity);
	}
}
